<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 				<meta charset="UTF-8"> -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <title>消防设备详情 </title>
    <!-- 引入 WeUI CDN 链接 -->
    <link rel="stylesheet" href="https://res.wx.qq.com/open/libs/weui/2.3.0/weui.min.css"/>
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" ></script>
    <script>
        $(document).ready(function(){
            debugger;
            var code = document.location.search.substring(6) + document.location.hash;
            $.ajax({type:"GET",url:'/findDeviceDetailByCode',dataType:'JSON', contentType:'application/json', data:{code:code},
                success:function(result){
                    if(result.success){
                        var data = result.data;
                        $("#code").text(data.code);
                        $("#typeText").text(data.typeText);
                        $("#positionText").text(data.positionText);
                        $("#statusText").text(data.statusText);
                        $("#auditUserName").text(data.auditUserName);
                        $("#gmtAudit").text(data.gmtAudit);
                        $("#weightType").text(data.weightType);
                        $("#area").text(data.area);
                        $("#memo").text(data.memo);
                    }else{

                    }
                }});

        });
        function renderValue(code,typeText,auditUserName,auditTime,memo){


        }

        /**
          * 格式化日期
          * @param {string | number | Date} value 指定日期
          * @param {string} format 格式化的规则
          * @example
          * ```js
          * formatDate();
          * formatDate(1603264465956);
          * formatDate(1603264465956, "h:m:s");
          * formatDate(1603264465956, "Y年M月D日");
          * ```
          */
        function formatDate(value = Date.now(), format = "Y-M-D h:m:s") {
            const formatNumber = n => `0${n}`.slice(-2);
            const date = new Date(value);
            const formatList = ["Y", "M", "D", "h", "m", "s"];
            const resultList = [];
            resultList.push(date.getFullYear().toString());
            resultList.push(formatNumber(date.getMonth() + 1));
            resultList.push(formatNumber(date.getDate()));
            resultList.push(formatNumber(date.getHours()));
            resultList.push(formatNumber(date.getMinutes()));
            resultList.push(formatNumber(date.getSeconds()));
            for (let i = 0; i < resultList.length; i++) {
                format = format.replace(formatList[i], resultList[i]);
            }
            return format;
        }
    </script>
</head>
<body>
<!-- 使用 -->
<!--<a href="javascript:;" class="weui-btn weui-btn_primary">绿色按钮</a>-->

<div class="page">

    <div class="page__bd">
        <div class="weui-cells__title">消防设备详情 </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">编码 ：</span><span id="code"></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>

        </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">类型 ：</span><span id="typeText" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>

        </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">位置 ：</span><span id="positionText" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>

        </div>
        <div class="weui-cells">
            <div class="weui-cell ">

                <div class="weui-cell__bd">
                    <p><span style="color:gray">本月是否已检查 ：</span><span id="statusText" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>

        </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">核查人 ：</span><span id="auditUserName" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>

        </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">最近一次检查时间  ：</span><span id="gmtAudit" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>

        </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">重量/型号  ：</span><span id="weightType" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>
        </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">位置  ：</span><span id="area" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>
        </div>
        <div class="weui-cells">
            <div class="weui-cell ">
                <div class="weui-cell__bd">
                    <p><span style="color:gray">备注  ：</span><span id="memo" ></span></p>
                </div>
                <!--<div class="weui-cell__ft">说明文字</div>-->
            </div>

        </div>
    </div>
</div>

</body>
</html>
